//
//  UserDefaultUtil.m
//  Hive
//
//  Created by 惠俊贝 on 15/8/24.
//  Copyright (c) 2015年 ZM. All rights reserved.
//

#define USERDEFAULT [NSUserDefaults standardUserDefaults]

#import "UserDefaultUtil.h"
#import "Customer.h"

@implementation UserDefaultUtil

+ (void)setToken:(NSString *)tokenStr {
    [USERDEFAULT setObject:tokenStr forKey:@"__token"];
}

+ (NSString *)getToken {
    return [USERDEFAULT stringForKey:@"__token"];
}


+ (void)setUserName:(NSString *)username {
    [USERDEFAULT setObject:username forKey:@"__username"];
}

+ (NSString *)getUserName {
    return [USERDEFAULT stringForKey:@"__username"];
}


+ (void)setUserID:(NSString *)userid {
    [USERDEFAULT setObject:userid forKey:@"__userid"];
}

+ (NSString *)getUserID {
    return [USERDEFAULT stringForKey:@"__userid"];
}


+ (void)setTempQty:(NSString *)TempQty{
    [USERDEFAULT setObject:TempQty forKey:@"__TempQty"];
}
+ (NSString *)getTempQty {
    return [USERDEFAULT stringForKey:@"__TempQty"];
}

+ (void)setSystem:(NSString *)System {
    [USERDEFAULT setObject:System forKey:@"__System"];
}
+ (NSString *)getSystem {
    return [USERDEFAULT stringForKey:@"__System"];
}


+ (void)setAleaQty:(NSString *)AleaQty {
    [USERDEFAULT setObject:AleaQty forKey:@"__AleaQty"];
}
+ (NSString *)getAleaQty {
    return [USERDEFAULT stringForKey:@"__AleaQty"];
}


+ (void)setCustomer:(Customer *)Customer {
    [USERDEFAULT setObject:Customer forKey:@"__Customer"];
}
+ (Customer *)getCustomer {
    return [USERDEFAULT objectForKey:@"__Customer"];
}

@end

@implementation UserDefaultUtil (UserSet)

+ (void)setIsAutoLogin:(BOOL)selected {
    [USERDEFAULT setBool:selected forKey:@"__isAutoLogin"];
}
+ (BOOL)isAutoLogin {
    return [USERDEFAULT boolForKey:@"__isAutoLogin"];
}
+ (void)setIsRememberPSWD:(BOOL)selected {
    [USERDEFAULT setBool:selected forKey:@"__isRemeberPSWD"];
}
+ (BOOL)isRememberPSWD {
    return [USERDEFAULT boolForKey:@"__isRemeberPSWD"];
}

+ (void)setUserAccount:(NSString *)account {
    [USERDEFAULT setObject:account forKey:@"__account"];
}
+ (NSString *)getUserAccount {
    return [USERDEFAULT objectForKey:@"__account"];
}
+ (void)setPassword:(NSString *)password {
    [USERDEFAULT setObject:password forKey:@"__password"];
}
+ (NSString *)getPassword {
    return [USERDEFAULT objectForKey:@"__password"];
}
@end